﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;
using $safeprojectname$.Infrastructure.Factories;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace $safeprojectname$.Core.Publishing.Configuration
{
    [TestClass]
    public class ConfigurationHandlerSectionTest : TestBase
    {
        [TestMethod]
        public void NullProvider_Passed()
        {
            var configuration = PublishingConfigurationFactory.GetNullProvider();
            Assert.IsTrue(configuration.ProviderType.Contains("NullPublishingProvider"));
        }

        [TestMethod]
        public void DefaultProvider_Passed()
        {
            var configuration = PublishingConfigurationFactory.GetDefaultProvider();
            Assert.IsTrue(configuration.ProviderType.Contains("DefaultPublishingProvider"));
        }
        [TestMethod]
        public void Provider_Log4NetOnly_Passed()
        {
            var configuration = PublishingConfigurationFactory.GetProviderWithLog4NetOnly();
            Assert.IsTrue(configuration.ProviderType.Contains("DefaultPublishingProvider"));
        }
        [TestMethod]
        public void Provider_ExceptionOnly_Passed()
        {
            var configuration = PublishingConfigurationFactory.GetProviderWithExceptionOnly();
            Assert.IsTrue(configuration.ProviderType.Contains("DefaultPublishingProvider"));
        }

        [TestMethod]
        public void Provider_IsMissing_Passed()
        {
            var configuration = PublishingConfigurationFactory.GetMissingProvider();
            Assert.IsTrue(configuration.ProviderType.IsNull());
        }

        #region Init

        // You can use the following additional attributes as you write your tests:

        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }

        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }

        [TestInitialize]
        public override void MyTestInitialize()
        {
            base.MyTestInitialize(); // Use TestInitialize to run code before running each test
        }

        [TestCleanup]
        public override void MyTestCleanup()
        {
            base.MyTestCleanup(); // Use TestCleanup to run code after each test has run
        }
        #endregion Init
    }
}
